package com.ustadzmenjawab.twitter;

import java.util.Date;
import java.util.TimeZone;

import com.ustadzmenjawab.db.DBAccess;

public class CalculateTopTweet {

	public static final long SLEEP_DURATION = 5 * 60 * 1000;
	public static void main(String[] args) {
		TimeZone.setDefault(TimeZone.getTimeZone("Asia/Jakarta"));
		while(true){
			try {
				DBAccess db = new DBAccess();
				db.migrateTopTweet();
				System.out.println(new Date()+ " Top tweet just recalculated...");
				Thread.sleep(SLEEP_DURATION);
			}catch(Exception e){
				e.printStackTrace();
			}
		}
	}

}
